<input id="url_name" type="hidden" value="<?php echo url_for('@check_rule_name') ?>" />
<div id="rules_body_context">
    <div style="margin-top:20px;"><a class="rules_option content_option" style="font-size:20px;" href="<?php echo url_for('@mod_rules_editor_add') ?>" title="Dodaj zasady gry"><?php echo image_tag('iAdd.png',array('class'=>'option_img','style'=>'vertical-align:middle'))?>dodaj</a></div>
    <table class="content_table">
		<colgroup style="width:48px"></colgroup>
		<colgroup style="width:*"></colgroup>
		<colgroup style="width:80px"></colgroup>
		<colgroup style="width:160px"></colgroup>
		
		<tr id="header">
			<td>#</td>
			<td>Nazwa zasad gry</td>
			<td>Typ</td>
			<td>Data modyfikacji</td>
		</tr>
		<?php $i=12*($Page-1)+1; foreach($pager->getResult() as $rule): ?>
		<tr class="tr_odd">
			<td><?php echo $i++ ?></td>
			<td id="content_name"><a href="<?php echo url_for('@show_rules?id='.$rule->getId()) ?>" title="Zobacz zasady gry"><?php echo image_tag('iBrowse.png',array('class'=>'option_img'))?><?php echo $rule->getName() ?></a><div id="options">
			<a class="rules_option content_option" href="<?php echo $rule->getType()?url_for('@mod_rules_edit_tree?id='.$rule->getId()):url_for('@mod_rules_edit_matrix?id='.$rule->getId()) ?>" title="Edytuj zasady gry"><?php echo image_tag('iEdit.png',array('class'=>'option_img'))?>edytuj</a>
			<a class="rules_option content_option rule_delete" href="<?php echo url_for('@mod_rules_delete?id='.$rule->getId()) ?>" title="Usuń zasady gry"><?php echo image_tag('iDel.png',array('class'=>'option_img'))?>usuń</a>
			<a class="rules_option content_option" href="<?php echo url_for('@mod_rules_clone?id='.$rule->getId()) ?>" title="Kopiuj zasady gry"><?php echo image_tag('iAdd.png',array('class'=>'option_img'))?>kopiuj</a></div></td>
			<td><?php echo $rule->getType()?"drzewo":"macierz" ?></td>
			<td><?php echo $rule->getUpdatedAt('d.m.Y H:i') ?></td>
		</tr>
		<?php endforeach ?>
		<tr>
			<td colspan="4" id="footer">
			
				    <div class="pagination_small">
						<?php if ($pager->getTotalPages() > 1): ?>
							<?php if ($link = $pager->getPrev()): ?>
								<?php echo link_to('«', url_for('@mod_rules' . '?page='.$link)) ?>
							<?php endif ?>

							<?php foreach ($pager->getPrevLinks() as $link): ?>
								<?php echo link_to($link, url_for('@mod_rules' . '?page='.$link)) ?>
							<?php endforeach ?>

							<?php echo $pager->getPage() ?>

							<?php foreach ($pager->getNextLinks() as $link): ?>
								<?php echo link_to($link, url_for('@mod_rules' . '?page='.$link)) ?>
							<?php endforeach ?>

							<?php if ($link = $pager->getNext()): ?>
								<?php echo link_to('»', url_for('@mod_rules' . '?page='.$link)) ?>
							<?php endif ?>

						<?php endif; ?>
					</div>	
			
			</td>
		</tr>
	</table>
</div>